package com.example.demo1;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.ArrayList;
import java.util.Scanner;

@SpringBootApplication
public class Demo1Application {

//	public static void main(String[] args) {
//
//		SpringApplication.run(Demo1Application.class, args);
//	}
public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	// 注意 hasNext 和 hasNextLine 的区别
	int n=in.nextInt();

	while(n--!=0) {
		int h=in.nextInt();
		int di=1;
		int count=1;
		h=h-di;
		while(h!=0) {
			if(h-(di*2)>=0) {

				count++;
				h=h-(di*2);
				di=di*2;
			}else {
				h=h-di;
				count++;
			}
		}
		System.out.println(count);
	}
}

}
